#include <iostream>

using namespace std;

class ShapeBase
{
public:
	//	return number of sides
	ShapeBase()	{}

	virtual int GetNumberOfSides(void)
	{
		return 0;
	}
};

class Square: public ShapeBase
{
public:
	int GetNumberOfSides(void)
	{
		return 4;
	}
};

class Triangle: public ShapeBase
{
public:
	int GetNumberOfSides(void)
	{
		return 3;
	}
};

void PrintNumSides(ShapeBase &shape)
{
	cout << "MyShape has " << shape.GetNumberOfSides() << " sides" << endl;
}

int main()
{
	ShapeBase	tmpShape;
	Triangle	tmpTriangle;
	Square		tmpSquare;

	PrintNumSides(tmpShape);
	PrintNumSides(tmpTriangle);
	PrintNumSides(tmpSquare);
}
